<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="java.sql.*"%>
<%@ include file="../common.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CHỈNH SỬA THÔNG TIN DỊCH VỤ</title>
<style type="text/css">

#a {
	color: blue;
	background-color: #FF9A00;
	display: block;
	text-decoration: none;
	font-family: cursive;
}

#a:HOVER {
	color: #FFFFFF;
	background-color: #FF4700;
	text-decoration: none;
	display: block;
	font-family: cursive;
}

#a:ACTIVE {
	background-color: #FF4700;
	text-decoration: none;
	display: block;
	font-family: cursive;
}
#a:LANG {
	color: #FFFFFF;
	background-color: #FF4700;
	text-decoration: none;
	display: block;
	font-family: cursive;
}

</style>
</head>
<body>
<p align=center><font size=10>CHỈNH SỬA THÔNG TIN KHÁCH HÀNG</font></p>
<%
// 	String userid=getVal((String)session.getValue("userid"),"");
// 	if(userid.equals("")|| userid.equals("0") || userid.equals("-1")|| userid.equals("-2")) response.sendRedirect("admin.jsp");
%>
<%
	Class.forName("com.mysql.jdbc.Driver");
	Connection con = null;
	Statement smt = null;
	ResultSet rst = null;
	String str = null;
	String customer_card = request.getParameter("customer_card");
	try {
		String username = "root";
		String password = "Vietyeutam1112";
		String url = "jdbc:mysql://127.0.0.1:3306/ghmotel";
		con = DriverManager.getConnection(url, username, password);
		System.out.println("Da ket noi CSDL");
		smt = con.createStatement();
		rst = smt.executeQuery("select * from customer where customer_card ="+customer_card);
		rst.next();
		out.println("<form action=sql_customer_edit.jsp method=POST>");
		out.println("<table width=1024 align=center>");
		out.println("<tr><td width=1024 align='center' colspan=2><a id='a' href='customer_manager.jsp'>Quay về trang quản lý khách hàng</a><br><br></td></tr>");
		out.println("<tr><td width=30% align=right>Tên khách hàng </td>");
		out.println("<td width=70% align=left><input name=customer_name type=text size=50 value='"+rst.getString(2)+"'></td></tr>");
		out.println("<tr><td width=30% align=right>Địa chỉ:</td>");
		out.println("<td width=70% align=left><input name=customer_address type=text size=50 value='"+rst.getString(3)+"'></td></tr>");
		out.println("<tr><td width=30% ><input type=hidden name=customer_card value='"+customer_card+"'</td>");
		out.println("<td width=70% align=right><input type=submit value=Xong></td></tr>");
		out.println("</table>");
		out.println("</form>");
	} catch (Exception ex) {}
	con.close();
	
%>
</body>
</html>